//
//  ChatViewModel.h
//  MiniWeChat
//
//  Created by ByteDance on 2025/6/24.
//

#import "WXViewModel.h"
#import "UserModel.h"
#import "MessageModel.h"
#import "ConversationModel.h"
#import "GlobalConstants.h"

@interface ChatViewModel : WXViewModel

@property(nonatomic, strong) UserModel *sender;
@property(nonatomic, strong) UserModel *receiver;
@property(nonatomic, strong) ConversationModel *conversation;
@property(nonatomic, strong) NSMutableArray<MessageModel *> *messages;

- (instancetype)initWithConversation:(ConversationModel *)conversation;

// 通知监听相关
- (void)startNotificationListening;
- (void)stopNotificationListening;

// 消息相关
- (void)fetchMessages;
- (void)sendMessage:(NSString *)context;

// 表格视图相关
- (NSInteger)numberOfMessages;
- (MessageModel *)messageAtIndex:(NSInteger)index;

@end
